package cn.wolfcode.p2p.base.service.impl;

import cn.wolfcode.p2p.base.domain.RealAuth;
import cn.wolfcode.p2p.base.service.ISmsService;
import cn.wolfcode.p2p.event.RealAuthSuccessEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

@Service
public class SmsServiceImpl implements ISmsService,ApplicationListener<RealAuthSuccessEvent> {

    @Override
    public void onApplicationEvent(RealAuthSuccessEvent event) {
        this.sendMessage(event.getRealAuth());

    }

    //短信服务接收时间,实现
    private void sendMessage(RealAuth realAuth){
        System.out.println("用户" + realAuth.getApplier().getUsername() + "实名认证成功,发送短信");

    }

}
